<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    手机号码： <input type="number"> <button>发送</button>
    <script>
        var btn = document.querySelector('button')
        var timeCnt = 5;

        btn.addEventListener('click',function(){
            btn.disabled = true;
            var timer = setInterval(function(){
                btn.innerHTML = timeCnt+'秒后可重新发送'
                
                if(timeCnt == 0){
                    clearInterval(timer)
                    btn.disabled = false;
                    btn.innerHTML = '发送'
                    timeCnt = 5
                }else{
                    timeCnt--
                }
            },1000)
        })
    </script>
</body>

</html>